<%@page import="cn.jhc.dao.TitleDAO"%>
<%@page import="cn.jhc.dao.AnnouncementDAO"%>
<%@page import="cn.jhc.bean.NewsBean"%>
<%@page import="java.util.ArrayList"%>
<%@page import="cn.jhc.dao.ConnectionFactory"%>
<%@page import="cn.jhc.dao.MailDAO"%>
<%@page import="cn.jhc.bean.UserBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<link rel="stylesheet" type="text/css" href="css/main.css"></link>
<div id="top">
		<%
			NewsBean n = new NewsBean();
			AnnouncementDAO dao = new AnnouncementDAO();
			dao.setCon(ConnectionFactory.getConnection());
			n = dao.getOneAnn();
			request.setAttribute("ann", n);
		%>
	<div style="text-align: center">
		<marquee style="text-align: center" width="900px;" scrollamount="5"
			scrolldelay="200" direction="left" behavior="scroll" loop="x"
			onmouseover="this.stop()" onmouseout="this.start()">
			<div class="gonggao">
				<a>公告：${requestScope.ann.context}--${requestScope.ann.date}</a>
			</div>
		</marquee>
	</div>
</div>
<div id="allinput">
	<%
		UserBean user = (UserBean) session.getAttribute("user");
		if (null == user) {
	%>
	<div id="input">
		<div class="input_date"><jsp:include page="./date.jsp"></jsp:include></div>
		<a href="login.jsp?getb=/index.jsp">登录</a><a>|</a> 
		<a href="index.jsp">注销</a><a>|</a>
		<a href="addnewuser.jsp">注册　</a> 
	</div>
	<%
		} else {
	%>
	<%
			int mailNum;
			MailDAO dao5 = new MailDAO();
			dao5.setCon(ConnectionFactory.getConnection());
			mailNum = dao5.getMailCount(user.getDisplayname()); 
	%>		
	<%
		int integral;
		TitleDAO dao2 = new TitleDAO();
		dao2.setCon(ConnectionFactory.getConnection());
		int userid = user.getId();
		integral = dao2.showIntegral(userid);
	%>
	<div id="input">
		<div class="input_date"><jsp:include page="./date.jsp"></jsp:include></div>
		<a>欢迎您！会员：${sessionScope.user.displayname}</a><a>|</a><a>拥有积分:(<%=integral%>)</a><a>|</a><a href="mailindex.jsp">消息(<%=mailNum%>)</a><a>|</a><a
			href="cancellation.do">注销</a><a>|</a>
			<a href="addnewuser.jsp">注册</a> 
	</div>
	<%
		}
	%>
</div>
<div id="logo">
	<img src="./images/logo4.jpg" width="300"></img>
</div>
<div id="nav">
	<span><a href="index.jsp">首 页</a></span> <span><a
		href="news.jsp?page=1">新闻中心</a></span> <span><a href="activities.jsp?page=1">活动信息</a></span>
	<span><a href="showmv.jsp">每月之星</a></span> <span><a
		href="alltaolunqu.jsp">讨论区</a></span> <span><a href="yuepudownload.jsp?search=no">吉他乐谱</a></span>
	<span><a href="showallgoods.do?cond=all">吉他小店</a></span>
</div>
<div id="navdown">
</div>